package DataBase;
/*
 * Junit test cases for the Database class
 * @author Accarp Tambe
 * Feb 02,2011
 */

import java.awt.Color;

import junit.framework.TestCase;

import org.junit.After;
import org.junit.Before;

public class DataBaseTest extends TestCase{
	
	DataBase db;
	
	@Before
	public void setUp() throws Exception {
		super.setUp();
		 db = new DataBase(); 
		 
	}

	

	public void testgetGreenColor(){
		assertEquals(db.getGreenColor(), (Color.green));
	}
	
	public void testgetBlueColor(){
		
		assertEquals(db.getBlueColor(), (Color.blue));
	}
	
	public void testgetRedColor(){
		 assertEquals(db.getRedColor(), (Color.red));
	}
	
	public void testsetSearchString(String string){
		db.setSearchString("testString");
		assertSame(db.getSearchString(), "testString");
	}	
	
	
	public void testgetSearchString(){
		db.setSearchString("testString");
		assertTrue(db.getSearchString().equals ( "testString"));
	}
	
	public void testsetUserSelectHighlightColor(Color _userSelectHighlightColor){
		
		db.setUserSelectHighlightColor(Color.blue);
		assertTrue(db.getUserSelectHighlightColor().equals(Color.blue));
	}
	
	
	public void testgetUserSelectHighlightColor(){
		
		db.setUserSelectHighlightColor(Color.green);
		assertEquals(db.getUserSelectHighlightColor(),(Color.green)); 
	} 
	
	
	public void testgetNumberOfElementInArrayList(){
		//this should return true
		assertEquals(db.getNumberOfElementInArrayList(),3);
		
	}
	
	
	@After
	public void tearDown() throws Exception {
		super.tearDown();
	}
}

